package gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.WindowConstants;

import cont.ControladorVistas;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class ViewArchivo extends javax.swing.JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JScrollPane jScroll1;
	private JTextArea jTextArea1;
	private JButton jButtonSalir;
	private ControladorVistas cont;

	
	public ViewArchivo(String texto, String tipo) {
		super();
		setTitle(tipo);
		setVisible(true);
		initGUI();
		jTextArea1.setText(texto);
		
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				jScroll1 = new JScrollPane();
				getContentPane().add(jScroll1);
				jScroll1.setBounds(25, 52, 555, 512);
				{
					jTextArea1 = new JTextArea();
					jScroll1.setViewportView(jTextArea1);
					
				}
			}
			{
				jButtonSalir = new JButton();
				getContentPane().add(jButtonSalir);
				jButtonSalir.setText("SALIR");
				jButtonSalir.setBounds(452, 12, 128, 29);
				jButtonSalir.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						cont.salirViewArchivo();
					}
				});
			}
			this.addComponentListener(new ComponentAdapter() {
			});
			pack();
			this.setSize(608, 625);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public void setControlador(ControladorVistas c){
		this.cont = c;
	}
	

}
